feat: rewrite authoring bundle creation as wizard-style flow @W-21220749@#326
Conversation
Replace autocomplete spec selector with two-step type picker and file picker from specs/ directory. Remove interactive API name prompt in favor of auto-generation. Add MultiStageOutput progress reporting.
Add 18 unit tests covering flag-based usage, interactive wizard prompts, name/API name validation, error handling, and spec file filtering. Also restore the interactive API name prompt and refine wizard prompt text.
jshackell-sfdc
left a comment
There was a problem hiding this comment.
See my edits. NOTE that I'm not sure where these messages really appear, so I'm making a guess. Please fix things like incorrect punctuation (like me adding a period when there shouldn't be), etc.
| # error.failed-to-create-agent | ||
|
|
||
| Failed to create an authoring bundle from the agent spec YAML file. | ||
| Failed to generate authoring bundle: %s |
There was a problem hiding this comment.
| Failed to generate authoring bundle: %s | |
| Failed to generate authoring bundle: %s. |
|
|
||
| # wizard.specType.prompt | ||
|
|
||
| Select authoring bundle template |
There was a problem hiding this comment.
| Select authoring bundle template | |
| Select an authoring bundle template |
|
|
||
| # wizard.specType.option.default.name | ||
|
|
||
| Default template (recommended) |
There was a problem hiding this comment.
| Default template (recommended) | |
| Default template (Recommended) |
|
|
||
| # wizard.specType.option.fromSpec.name | ||
|
|
||
| From YAML spec (advanced) |
There was a problem hiding this comment.
| From YAML spec (advanced) | |
| From an agent spec YAML file (Advanced) |
|
|
||
| # wizard.specType.option.default.description | ||
|
|
||
| Start with a ready-to-use Agent Script template |
There was a problem hiding this comment.
| Start with a ready-to-use Agent Script template | |
| Start with a ready-to-use Agent Script template. |
|
|
||
| # wizard.specFile.prompt | ||
|
|
||
| Select authoring bundle YAML spec |
There was a problem hiding this comment.
| Select authoring bundle YAML spec | |
| Select the agent spec YAML file. |
|
|
||
| # wizard.name.prompt | ||
|
|
||
| Enter authoring bundle name |
There was a problem hiding this comment.
| Enter authoring bundle name | |
| Enter the authoring bundle name. |
|
|
||
| # wizard.name.validation.required | ||
|
|
||
| Bundle name is required |
There was a problem hiding this comment.
| Bundle name is required | |
| Authoring bundle name is required. |
|
|
||
| # wizard.name.validation.empty | ||
|
|
||
| Bundle name can't be empty. |
There was a problem hiding this comment.
| Bundle name can't be empty. | |
| Authroring bundle name can't be empty. |
|
|
||
| # warning.noSpecDir | ||
|
|
||
| No agent spec directory found at %s |
There was a problem hiding this comment.
| No agent spec directory found at %s | |
| No agent spec directory found at %s. |
WillieRuemmele
left a comment
There was a problem hiding this comment.
all seems fine, personally, I feel that the MSO is excessive, given it's a 17ms operation
──── Generating authoring bundle: my_agent_2 ────
✔ Creating authoring bundle structure... 4ms
✔ Generating Agent Script file... 5ms
✔ Complete! 0ms
Elapsed Time: 17ms
What does this PR do?
Rewrites the
agent generate authoring-bundleinteractive flow to use a wizard-style pattern that mirrors the VS Code extension. Replaces the autocomplete spec selector with a two-step approach (template type picker → YAML spec file picker fromspecs/directory), addsMultiStageOutputprogress reporting, and updates all user-facing prompt text. Includes 18 unit tests covering the full wizard flow.What issues does this PR fix or reference?
@W-21220749@
Functionality Before
*AgentSpec.yml/yamlfilesFunctionality After
specs/directoryMultiStageOutputprogress stages: "Creating authoring bundle structure..." → "Generating Agent Script file..." → "Complete!"-testSpec) are filtered out of the spec file listTesting Setup Notes
specs/directory exists at the project root with.yaml/.ymlfilessf agent generate authoring-bundleinteractively to verify:sf agent generate authoring-bundle --no-spec --name "Test" --api-name TestAgent --target-org <org>--specwith a direct path to verify it bypasses wizard promptsnpx mocha "test/commands/agent/generate/authoring-bundle.test.ts"